package com.csproj.basic.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.time.ZonedDateTime;
import java.util.Objects;


/**
 * 领用记录
 * @author Sun
 */
@ApiModel(description = "领用记录 @author Sun")
@Entity
@Table(name = "t_dis_collar_record")
public class CollarRecord implements Serializable {

    private static final long serialVersionUID = 1L;


    public static final Integer DEVICE_TYPE_ELE = 1; //手持机设备累心给

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "id")
    private String id;

    /**
     * 设备类型(1手持机，2电子关锁，3固定式读取设备)
     */
    @ApiModelProperty(value = "设备类型(1手持机，2电子关锁，3固定式读取设备)")
    @Column(name = "device_type")
    private Integer deviceType;

    /**
     * 设备Id
     */
    @ApiModelProperty(value = "设备Id")
    @Column(name = "device_id")
    private String deviceId;

    /**
     * 领用人
     */
    @ApiModelProperty(value = "领用人Id")
    @Column(name = "receiver_id")
    private String receiverId;

    /**
     * 领用时间
     */
    @ApiModelProperty(value = "领用时间")
    @Column(name = "receive_date")
    private ZonedDateTime receiveDate;

    /**
     * 归还时间
     */
    @ApiModelProperty(value = "归还时间")
    @Column(name = "back_date")
    private ZonedDateTime backDate;

    /**
     * 设备状态
     */
    @ApiModelProperty(value = "设备状态")
    @Column(name = "state")
    private String state;

    /**
     * 删除标志
     */
    @ApiModelProperty(value = "删除标志")
    @Column(name = "deleted_flag")
    private Boolean deletedFlag;

    /**
     * 删除人
     */
    @ApiModelProperty(value = "删除人")
    @Column(name = "deleter_user_id")
    private String deleterUserId;

    /**
     * 删除时间
     */
    @ApiModelProperty(value = "删除时间")
    @Column(name = "deletion_time")
    private ZonedDateTime deletionTime;

    /**
     * 最近更新时间
     */
    @ApiModelProperty(value = "最近更新时间")
    @Column(name = "last_modification_time")
    private ZonedDateTime lastModificationTime;

    /**
     * 最近更新人
     */
    @ApiModelProperty(value = "最近更新人")
    @Column(name = "last_modifier_user_id")
    private String lastModifierUserId;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "creation_time")
    private ZonedDateTime creationTime;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @Column(name = "creator_user_id")
    private String creatorUserId;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getDeviceType() {
        return deviceType;
    }

    public CollarRecord deviceType(Integer deviceType) {
        this.deviceType = deviceType;
        return this;
    }

    public void setDeviceType(Integer deviceType) {
        this.deviceType = deviceType;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public CollarRecord deviceId(String deviceId) {
        this.deviceId = deviceId;
        return this;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }


    public String getReceiverId() {
        return receiverId;
    }

    public CollarRecord receiverId(String receiverId) {
        this.receiverId = receiverId;
        return this;
    }

    public void setReceiverId(String receiverId) {
        this.receiverId = receiverId;
    }

    public ZonedDateTime getReceiveDate() {
        return receiveDate;
    }

    public CollarRecord receiveDate(ZonedDateTime receiveDate) {
        this.receiveDate = receiveDate;
        return this;
    }

    public void setReceiveDate(ZonedDateTime receiveDate) {
        this.receiveDate = receiveDate;
    }

    public  ZonedDateTime getBackDate()
    {
        return  backDate;
    }

    public CollarRecord backDate(ZonedDateTime backDate) {
        this.backDate = backDate;
        return this;
    }

    public void setBackDate(ZonedDateTime backDate) {
        this.backDate = backDate;
    }

    public String getState() {
        return state;
    }

    public CollarRecord state(String state) {
        this.state = state;
        return this;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Boolean isDeletedFlag() {
        return deletedFlag;
    }

    public CollarRecord deletedFlag(Boolean deletedFlag) {
        this.deletedFlag = deletedFlag;
        return this;
    }

    public void setDeletedFlag(Boolean deletedFlag) {
        this.deletedFlag = deletedFlag;
    }

    public String getDeleterUserId() {
        return deleterUserId;
    }

    public CollarRecord deleterUserId(String deleterUserId) {
        this.deleterUserId = deleterUserId;
        return this;
    }

    public void setDeleterUserId(String deleterUserId) {
        this.deleterUserId = deleterUserId;
    }

    public ZonedDateTime getDeletionTime() {
        return deletionTime;
    }

    public CollarRecord deletionTime(ZonedDateTime deletionTime) {
        this.deletionTime = deletionTime;
        return this;
    }

    public void setDeletionTime(ZonedDateTime deletionTime) {
        this.deletionTime = deletionTime;
    }

    public ZonedDateTime getLastModificationTime() {
        return lastModificationTime;
    }

    public CollarRecord lastModificationTime(ZonedDateTime lastModificationTime) {
        this.lastModificationTime = lastModificationTime;
        return this;
    }

    public void setLastModificationTime(ZonedDateTime lastModificationTime) {
        this.lastModificationTime = lastModificationTime;
    }

    public String getLastModifierUserId() {
        return lastModifierUserId;
    }

    public CollarRecord lastModifierUserId(String lastModifierUserId) {
        this.lastModifierUserId = lastModifierUserId;
        return this;
    }

    public void setLastModifierUserId(String lastModifierUserId) {
        this.lastModifierUserId = lastModifierUserId;
    }

    public ZonedDateTime getCreationTime() {
        return creationTime;
    }

    public CollarRecord creationTime(ZonedDateTime creationTime) {
        this.creationTime = creationTime;
        return this;
    }

    public void setCreationTime(ZonedDateTime creationTime) {
        this.creationTime = creationTime;
    }

    public String getCreatorUserId() {
        return creatorUserId;
    }

    public CollarRecord creatorUserId(String creatorUserId) {
        this.creatorUserId = creatorUserId;
        return this;
    }

    public void setCreatorUserId(String creatorUserId) {
        this.creatorUserId = creatorUserId;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CollarRecord collarRecord = (CollarRecord) o;
        if (collarRecord.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), collarRecord.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "CollarRecord{" +
            "id=" + getId() +
            ", deviceType=" + getDeviceType() +
            ", deviceId='" + getDeviceId() + "'" +
                ", receiverId='" + getReceiverId() + "'" +
                ", receiveDate='" + getReceiveDate() + "'" +
                ", backDate='" + getBackDate() + "'" +
            ", state='" + getState() + "'" +
            ", deletedFlag='" + isDeletedFlag() + "'" +
            ", deleterUserId='" + getDeleterUserId() + "'" +
            ", deletionTime='" + getDeletionTime() + "'" +
            ", lastModificationTime='" + getLastModificationTime() + "'" +
            ", lastModifierUserId='" + getLastModifierUserId() + "'" +
            ", creationTime='" + getCreationTime() + "'" +
            ", creatorUserId='" + getCreatorUserId() + "'" +
            "}";
    }
}
